//---------------------------------------------------------------------------
#ifndef CCompDLLH
#define CCompDLLH
//---------------------------------------------------------------------------
#include "compta.h"
#ifdef __BCPLUSPLUS__
  #include "eic.h"
  #define MyBOOL bool
#else
  #define MyBOOL BYTE
#endif
//---------------------------------------------------------------------------
	typedef void*      (__cdecl     *CPTAlloueMemComptes)( short nbEnsemblesComptes, va_list vaComptes);
	typedef void       (__cdecl     *CPTLibereMemComptes)( void* pv);
	typedef void       (__stdcall   *CPTOpenTables      )( void);
	typedef void       (__stdcall   *CPTCloseTables     )( void);
	typedef void       (__stdcall   *CPTParamComptes    )( int nCodeEnsemble, MyBOOL bFenetre);
	typedef void       (__stdcall   *CPTGetCompteC      )( char *pszCompte, int nLen, int nCodeEnsemble, int nCodeCompte);
#ifdef __BCPLUSPLUS__
	typedef AnsiString  __fastcall (*CPTGetCompte       )( int nCodeEnsemble, int nCodeCompte);
	typedef void        __fastcall (*CPTInitEnsembles   )( CBarre *pBarre, int nNbEnsembles, va_list lstEnsembles);
  typedef void        __fastcall (*CPTMigrerComptesTmp)( const AnsiString &RepTmp);

  class PACKAGE_COMPTA CComptesDLL
  {
    private:
      HINSTANCE           m_hinstComptes;
      CPTOpenTables       m_pfncOpenTables;
      CPTCloseTables      m_pfncCloseTables;
      CPTGetCompte        m_pfncGetCompte;
      CPTInitEnsembles    m_pfncInitEnsembles;
      CPTParamComptes     m_pfncParamComptes;
      CPTMigrerComptesTmp m_pfncMigrerComptesTmp;

    public:
      __fastcall  CComptesDLL( void);
      virtual __fastcall ~CComptesDLL( void);

             void       __cdecl    InitEnsembles( CBarre *pBarre, int nNbEnsembles, ...);
      inline void       __fastcall OpenTables( void) { m_pfncOpenTables(); };
      inline void       __fastcall CloseTables( void) { m_pfncCloseTables(); };
      inline AnsiString __fastcall GetCompte( int nCodeEnsemble, int nCodeCompte) { return m_pfncGetCompte( nCodeEnsemble, nCodeCompte); };
      inline void       __fastcall ParamComptes( int nCodeEnsemble, bool bFenetre) { m_pfncParamComptes( nCodeEnsemble, bFenetre); };
      inline void       __fastcall MigrerComptesTmp( const AnsiString &RepTmp) { return m_pfncMigrerComptesTmp( RepTmp); };
  };
#endif
//---------------------------------------------------------------------------
#endif
